<!--
	添加thymeleaf的命名空间
	xmlns:th="http://www.thymeleaf.org"
-->
<html xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta charset="utf-8">
		<link rel="stylesheet" href="css/index.css">
		<script language="JavaScript" src="js/index.js"></script>
	</head>
	<body>
		<div id="div_container">
			<p class="center f30">欢迎使用水果库存后台管理系统</p>
			<div style="border:0px solid red;width:60%;margin-left:20%;text-align:right;">
				<!--这里的a标签没有走服务器的请求，直接转到add.html，即该add.html页面没有经过thymeleaf模板引擎渲染-->
				<a th:href="@{/add.html}" style="border:0px solid blue;margin-bottom:4px;">添加新库存记录</a>
			</div>
			<div id="div_fruit_list">
				<table id="tbl_fruit">
					<tr>
						<th class="w20">名称</th>
						<th class="w20">单价</th>
						<th class="w20">库存</th>
						<th>操作</th>
					</tr>
					<tr th:if="${#lists.isEmpty(session.fruitList)}">
						<td colspan="4">对不起，库存为空！</td>
					</tr>
					<tr th:unless="${#lists.isEmpty(session.fruitList)}" th:each="fruit:${session.fruitList}">
						<!--<td ><a th:text="${fruit.fname}" th:href="@{'/edit.do?fid='+${fruit.fid}}"></a></td>-->
						<td ><a th:text="${fruit.fname}" th:href="@{/edit.do(fid=${fruit.fid})}"></a></td>
						<td th:text="${fruit.price}"></td>
						<td th:text="${fruit.fcount}"></td>
						<td><img src="imgs/del.jpg" class="delImg" th:onclick="|deleteFruit(${fruit.fid})|"/></td>
					</tr>
				</table>
			</div>
		</div>
	</body>
</html>
